<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Insert title here</title>
<!-- <script type="text/javascript" charset="utf-8" src="cordova.js"></script> -->
<!-- <script type="text/javascript" charset="utf-8" src="Toast.js"></script> -->
<!--<script>
	// PhoneGap加载完毕
	function onDeviceReady() {
		//按钮事件
		document.addEventListener("backbutton", eventBackButton, false); //返回键
		document.addEventListener("menubutton", eventMenuButton, false); //菜单键
		document.addEventListener("searchbutton", eventSearchButton, false); //搜索键
	}

	//返回键
	function eventBackButton() {
		//confirm("再点击一次退出!");
		window.plugins.toast.showShortBottom('再点击一下返回，将退出私募通。');
		document.removeEventListener("backbutton", eventBackButton, false); //注销返回键
		//3秒后重新注册
		var intervalID = window.setInterval(function() {
			window.clearInterval(intervalID);
			document.addEventListener("backbutton", eventBackButton, false); //返回键
		}, 3000);
	}
	//菜单键
	function eventMenuButton() {
		window.plugins.toast.showShortTop('click Menu Button');
	}
	//搜索键
	function eventSearchButton() {
		window.plugins.toast.showShortTop('click Search Button!');
	}
</script>

<!-- 
<script>
	console.info("load");
	window.onbeforeunload = function() {
		event.returnValue = "确定离开当前页面吗？";
	}
</script>
-->

<script>
　　function checkLeave(){
　　　　alert("欢迎下次再来！");
　　}
</script>

</head>
<body onunload="checkLeave()">微信JS页面，测试监听返回键111
</body>
</html>